package com.jiuli.liping.controller;

import com.jiuli.liping.test.MyAsyncTask;
import com.jiuli.liping.vo.Classification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping(value = "/my")
public class MyController {
    @Autowired
    private MyAsyncTask myAsyncTask;

    @RequestMapping(value = {"/test", ""}, method = RequestMethod.POST)
    public void test() throws InterruptedException{
        long start = System.currentTimeMillis();
        myAsyncTask.task2();
        myAsyncTask.task3();
        long end = System.currentTimeMillis();
        System.out.println("任务1：耗时"+ (end-start) + "豪秒");
    }
}
